﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WeMakeSP.Platform.SharePoint.BusinessEntities;

namespace WeMakeSP.SiteManagement.UI.Models
{
    /// <summary>
    /// 
    /// </summary>
    public class SiteHierarchyModel : SiteManagementModelBase, ISiteHierarchyModel
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="SiteHierarchyModel"/> class.
        /// </summary>
        /// <param name="siteUrl">The site URL.</param>
        public SiteHierarchyModel(string siteUrl)
            : base(siteUrl)
        {
        }

        #endregion

        #region Public Methods

        /// <summary>
        /// Updates the webs master page.
        /// </summary>
        /// <param name="webIds">The web ids.</param>
        /// <param name="masterPage">The master page.</param>
        public void UpdateWebsMasterPage(List<Guid> webIds, SPMasterPage masterPage)
        {
            foreach (Guid webId in webIds)
            {
                this.UpdateMasterPage(webId, masterPage);
            }
        }

        /// <summary>
        /// Updates the webs logo.
        /// </summary>
        /// <param name="webIds">The web ids.</param>
        /// <param name="webLogo">The web logo.</param>
        public void UpdateWebsLogo(List<Guid> webIds, SPWebLogo webLogo)
        {
            foreach (Guid webId in webIds)
            {
                this.UpdateWebLogo(webId, webLogo);
            }
        }

        /// <summary>
        /// Updates the webs theme.
        /// </summary>
        /// <param name="webIds">The web ids.</param>
        /// <param name="theme">The theme.</param>
        public void UpdateWebsTheme(List<Guid> webIds, string theme)
        {
            foreach (Guid webId in webIds)
            {
                this.UpdateWebTheme(webId, theme);
            }
        }

        #endregion
    }
}
